# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-qt-material
pkgver=2.14
pkgrel=1
pkgdesc='Material inspired stylesheet for PySide & PyQt'
arch=('any')
url='https://qt-material.readthedocs.io/'
license=('BSD' 'Apache')
depends=('python-jinja')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
_commit='5a99be3d6914cd5570282b29968aa39a7f8d1408'
source=("$pkgname::git+https://github.com/UN-GCPDS/qt-material#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  # first known commit to receive latest version
  local _pkgver='2.14'
  local _pkgcommit='5a99be3d6914cd5570282b29968aa39a7f8d1408'

  git tag "$_pkgver" "$_pkgcommit"

  #git describe --tags | sed -e 's/^v//' -e 's/-/.r/' -e 's/-/./g'
  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
